package com.sh.learn.ibeifeng.webservice.axis;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

//<service name="AddressManager" provider="java:RPC">
//<parameter name="className" value="com.sh.learn.ibeifeng.webservice.axis.AddressManager" />
//<parameter name="allowedMethods" value="*" />
//<beanMapping languageSpecificType="java:com.sh.learn.ibeifeng.webservice.axis.Address" qname="mynsl:Address" xmlns:mynsl="urn:BeanService" />
//<beanMapping languageSpecificType="java:com.sh.learn.ibeifeng.webservice.axis.Address$Innerclass" qname="mynsl:InnerClass" xmlns:mynsl="urn:BeanInnerService" />
//</service>
public class AddressManager {
	//定制不同服务方法
	public List<Address> getAddressList(){
		List<Address> returnlist=new ArrayList<Address>();
		Address address=new Address();
		address.setAddress("天津");
		address.setCity("南开区");
		address.setCountry("中国");
		address.setExist(false);
		address.setArray(new String[]{"a","b","c"});
		returnlist.add(address);
		
		address=new Address();
		address.setAddress("北京");
		address.setCity("海淀");
		address.setCountry("中国");
		address.setExist(true);
		address.setArray(new String[]{"a1","b1","c1"});
		returnlist.add(address);
		return returnlist;
	}
	
	public Map<Integer, Address> getAddressMap(){
		Map<Integer,Address> map=new HashMap<Integer, Address>();
		Address address=new Address();
		address.setAddress("天津");
		address.setCity("南开区");
		address.setCountry("中国");
		address.setExist(false);
		address.setArray(new String[]{"a","b","c"});
		map.put(1, address);
		address=new Address();
		address.setAddress("北京");
		address.setCity("海淀");
		address.setCountry("中国");
		address.setExist(true);
		address.setArray(new String[]{"a1","b1","c1"});
		map.put(2, address);
		return map;
	}

}
